//引入vue
import { createApp } from 'vue'
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const index = () => import('./page/index')
const login = () => import('./page/login')
//定义routes路由的集合，数组类型
const routes=[
    //单个路由均为对象类型，path代表的是路径，component代表组件
    {
        path:'/',
        redirect: {
            name: "login"
        }
    },
    {
        path:'/index',
        name:'index',
        component: index,
    },
    {
        path:'/login',
        name:'login',
        component:login
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

//抛出这个这个实例对象方便外部读取以及访问
export default router